package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.module.merchant.DeviceTypeQuery;
import com.uzai.console.dto.tb.tbridpid.TbRidPidQuery;
import com.uzai.console.entity.DeviceType;
import com.uzai.console.entity.TbRidPid;
import com.uzai.console.entity.TbToken;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Repository
public interface TbRidPidMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int deleteByTbTokenId(Long tbTokenId);

    int insert(TbRidPid record);

    int insertSelective(TbRidPid record);

    TbRidPid selectById(@Param("id") Long id, @Param("merId") Long merId);

    TbRidPid selectByRalationIdAndPid(@Param("relationId") String relationId, @Param("pid") String pid);

    int updateByIdSelective(TbRidPid record);

    int updateById(TbRidPid record);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<TbRidPid> findByPage(Page<TbRidPid> page, @Param("query") TbRidPidQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<TbRidPid> findByList(@Param("query") TbRidPidQuery query);

    /**
     * 查询rid个数未满300个的饿了么token
     * @author jitwxs
     * @date 2022/1/14 15:28
     * @return java.util.List<com.uzai.console.entity.TbToken>
     */
    List<TbToken> selectTbTokenListByRidLessThan300();

}